package com.asia5b.a5mall.middleware.api

import com.asia5b.a5mall.middleware.model.member.RegionModel
import com.asia5b.a5mall.middleware.model.member.UploadImgResModel
import com.asia5b.a5mall.middleware.model.other.UpdateModel
import com.asia5b.a5mall.middleware.model.shop.AgreementModel
import com.asia5b.a5mall.middleware.utils.UUID
import io.reactivex.Observable
import okhttp3.MultipartBody
import okhttp3.ResponseBody
import retrofit2.http.*

/**
 * Created by zhangyuncai on 2019/12/21.
 */
interface BaseApi {
    /**
     * @Note   国家公馆
     */
    @GET("country/all")
    fun getCountrys(): Observable<ResponseBody>

    /**
     * 图片验证码
     */
    @GET("captchas/{uuid}/{scene}")
    fun loadVcode(@Path("uuid") uuid: String = UUID.uuid, @Path("scene") scene: String): Observable<ResponseBody>

    /**
     * 获取地区
     */
    @GET("regions/{id}/children")
    fun loadRegion(@Path("id") id: Int): Observable<ArrayList<RegionModel>>

    /**
     * 上传图片
     */
    @Multipart
    @POST("uploaders")
    fun uploader(@Part() file: MultipartBody.Part, @Query("scene") scene: String): Observable<UploadImgResModel>

    /**
     * APP版本升级
     */
    @GET("app/{type}")
    fun checkUpdate(@Path("type") type: String = "Android"): Observable<UpdateModel>

    /**
     * 请求申请店铺的协议
     */
    @GET("pages/{position}/articles")
    fun getApplyShopAgreeContent(@Path("position") type: String = "COOPERATION_AGREEMENT"): Observable<AgreementModel>
}